home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Workbench Add-On
/
Workbench Add-On - Volume 1.iso
/
Dev
/
Oberon
/
source
/
amiga
/
Expansion.mod
< prev
next >
Wrap
Text File
|
1995-06-29
|
6KB
|
224 lines
(***************************************************************************
$RCSfile: Expansion.mod $
Description: Interface to expansion.library
Created by: fjc (Frank Copeland)
$Revision: 3.8 $
$Author: fjc $
$Date: 1995/06/04 23:13:14 $
Includes Release 40.15
(C) Copyright 1985-1993 Commodore-Amiga, Inc.
All Rights Reserved
Oberon-A interface Copyright © 1994-1995, Frank Copeland.
This file is part of the Oberon-A Interface.
See Oberon-A.doc for conditions of use and distribution.
***************************************************************************)
<* STANDARD- *>
MODULE [2] Expansion;
IMPORT SYS := SYSTEM, Kernel, e := Exec, d := Dos, c := Config, s := Sets;
(*
** $VER: expansion.h 36.7 (28.5.90)
**
** External definitions for expansion.library
*)
CONST
expansionName * = "expansion.library";
(* flags for the AddDosNode() call *)
startProc * = 0;
(*
** $VER: expansionbase.h 36.15 (21.10.91)
**
** Definitions for the expansion library base
*)
(* BootNodes are scanned by dos.library at startup. Items found on the
list are started by dos. BootNodes are added with the AddDosNode() or
the V36 AddBootNode() calls. *)
TYPE
BootNodePtr * = POINTER TO BootNode;
BootNode * = RECORD (e.NodeBase)
base * : e.Node;
flags * : s.SET16;
deviceNode * : e.NodePtr;
END; (* BootNode *)
(* expansion.library has functions to manipulate most of the information in
ExpansionBase. Direct access is not permitted. Use FindConfigDev()
to scan the board list. *)
TYPE
ExpansionBasePtr * = POINTER TO ExpansionBase;
ExpansionBase * = RECORD (e.LibraryBase)
libNode * : e.Library;
flags - : s.SET8; (* read only (see below) *)
private01 : e.UBYTE; (* private *)
private02 : e.ULONG; (* private *)
private03 : e.ULONG; (* private *)
private04 : c.CurrentBinding; (* private *)
private05 : e.List; (* private *)
mountList * : e.List; (* contains struct BootNode entries *)
(* private *)
END; (* ExpansionBase *)
CONST
(* error codes *)
ok * = 0;
lastBoard * = 40; (* could not shut him up *)
noExpansion * = 41; (* not enough expansion mem; board shut up *)
noMemory * = 42; (* not enough normal memory *)
noBoard * = 43; (* no board at that address *)
badMem * = 44; (* tried to add bad memory card *)
(* Flags *)
ebClogged * = 0; (* someone could not be shutup *)
ebShortMem * = 1; (* ran out of expansion mem *)
ebBadMem * = 2; (* tried to add bad memory card *)
ebDosFlag * = 3; (* reserved for use by AmigaDOS *)
ebKickBack33 * = 4; (* reserved for use by AmigaDOS *)
ebKickBack36 * = 5; (* reserved for use by AmigaDOS *)
(* If the following flag is set by a floppy's bootblock code, the initial
open of the initial shell window will be delayed until the first output
to that shell. Otherwise the 1.3 compatible behavior applies. *)
ebSilentStart * = 6;
(* Magic kludge for CC0 use *)
ebStartCC0 * = 7;
(**-- Library Base variable --------------------------------------------*)
VAR
base * : ExpansionBasePtr;
(**-- Library Functions ------------------------------------------------*)
(*
** $VER: expansion_protos.h 39.0 (31.10.91)
*)
(* --- functions in V33 or higher (distributed as Release 1.2) ---*)
PROCEDURE AddConfigDev* [base,-30]
( configDev [8] : c.ConfigDevPtr );
(* --- functions in V36 or higher (distributed as Release 2.0) ---*)
PROCEDURE AddBootNode* [base,-36]
( bootPri [0] : LONGINT;
flags [1] : s.SET32;
deviceNode [8] : d.DeviceNodePtr;
configDev [9] : c.ConfigDevPtr )
: BOOLEAN;
(* --- functions in V33 or higher (distributed as Release 1.2) ---*)
PROCEDURE AllocBoardMem* [base,-42]
( slotSpec [0] : e.ULONG );
PROCEDURE AllocConfigDev* [base,-48] ()
: c.ConfigDevPtr;
PROCEDURE AllocExpansionMem* [base,-54]
( numSlots [0] : e.ULONG;
slotAlign [1] : e.ULONG )
: e.APTR;
PROCEDURE ConfigBoard* [base,-60]
( board [8] : e.APTR;
configDev [9] : c.ConfigDevPtr );
PROCEDURE ConfigChain* [base,-66]
( baseAddr [8] : e.APTR );
PROCEDURE FindConfigDev* [base,-72]
( oldConfigDev [8] : c.ConfigDevPtr;
manufacturer [0] : LONGINT;
product [1] : LONGINT )
: c.ConfigDevPtr;
PROCEDURE FreeBoardMem* [base,-78]
( startSlot [0] : e.ULONG;
slotSpec [1] : e.ULONG );
PROCEDURE FreeConfigDev* [base,-84]
( configDev [8] : c.ConfigDevPtr );
PROCEDURE FreeExpansionMem* [base,-90]
( startSlot [0] : e.ULONG;
numSlots [1] : e.ULONG );
PROCEDURE ReadExpansionByte* [base,-96]
( board [8] : e.APTR;
offset [0] : e.ULONG )
: e.UBYTE;
PROCEDURE ReadExpansionRom* [base,-102]
( board [8] : e.APTR;
configDev [9] : c.ConfigDevPtr );
PROCEDURE RemConfigDev* [base,-108]
( configDev [8] : c.ConfigDevPtr );
PROCEDURE WriteExpansionByte* [base,-114]
( board [8] : e.APTR;
offset [0] : e.ULONG;
byte [1] : e.UBYTE );
PROCEDURE ObtainConfigBinding* [base,-120] ();
PROCEDURE ReleaseConfigBinding* [base,-126] ();
PROCEDURE SetCurrentBinding* [base,-132]
( currentBinding [8] : c.CurrentBindingPtr;
bindingSize [0] : e.UWORD );
PROCEDURE GetCurrentBinding* [base,-138]
( currentBinding [8] : c.CurrentBindingPtr;
bindingSize [0] : e.UWORD )
: e.ULONG;
PROCEDURE MakeDosNode* [base,-144]
( parmPacket [8] : e.APTR )
: d.DeviceNodePtr;
PROCEDURE AddDosNode* [base,-150]
( bootPri [0] : LONGINT;
flags [1] : s.SET32;
deviceNode [8] : d.DeviceNodePtr )
: BOOLEAN;
(* --- functions in V36 or higher (distributed as Release 2.0) ---*)
(* --- REMEMBER: You are to check the version BEFORE you use this ! --- *)
PROCEDURE ExpansionResrved26* [base,-156] ();
PROCEDURE WriteExpansionWord* [base,-162]
( board [8] : e.APTR;
offset [0] : LONGINT;
word [1] : INTEGER);
(**-- Library Base variable --------------------------------------------*)
<*$LongVars-*>
(**-----------------------------------*)
PROCEDURE* [0] CloseLib (VAR rc : LONGINT);
BEGIN (* CloseLib *)
IF base # NIL THEN e.CloseLibrary (base) END
END CloseLib;
BEGIN
base := SYS.VAL ( ExpansionBasePtr,
e.OpenLibrary (expansionName, e.libraryMinimum) );
IF base = NIL THEN HALT (100) END;
Kernel.SetCleanup (CloseLib)
END Expansion.